<?php

namespace app\index\controller;
use think\Controller;
use think\Db;
class Xwnr extends controller
{
    public function xwnr()
    {
        $where['id'] = ['like','%'.input('get.id').'%'];
        $news=Db::name('xwzx')->where($where)->order('sorts asc')->select();//模糊查询
        $this->assign('news',$news);//把$news的值赋值给news
        return view('index/xwnr');//映射模板路径
    }
}